package com.xintoucloud.pbs.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xintoucloud.pbs.entity.PartyPayment;
import com.xintoucloud.pbs.model.PartyMembershipDuesDto;
import com.xintoucloud.pbs.service.PartyPaymentService;

@Controller@RequestMapping("/PartyMembershipDues")
public class PartyMembershipDuesController {
	
	@Autowired
	private PartyPaymentService partyPaymentService;
	
	@RequestMapping("/login")
	public String login() {
		
		return "PartyMembershipDues";
	}
	
	
	@RequestMapping("/list")
	@ResponseBody
	public Map<String,Object> show(){
		Map<String,Object> map = new HashMap<>();
		List<PartyMembershipDuesDto> list = partyPaymentService.list();
		map.put("code", 0);
		map.put("data", list);
		return map;
	}
	
	@RequestMapping("/update")
	public void update(PartyPayment partyPayment) {
		partyPaymentService.update(partyPayment);
	}
	
}
